package chain;

public class EmergencyHandler extends SafetyHandler {
    @Override
    public void handleRequest(SafetyRequest request) {
        if (request.getRequestType().equals("EMERGENCY")) {
            System.out.println("EmergencyHandler: Handling emergency situation - shutting down equipment and alerting authorities");
        } else if (nextHandler != null) {
            nextHandler.handleRequest(request);
        } else {
            System.out.println("No handler available for request type: " + request.getRequestType());
        }
    }
}